﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using syc.Model;
namespace syc.DAL.Sale
{
    public class SaleInfo
    {
        ScqlDataContext db = new ScqlDataContext();
        public SaleInfo()
        {

        }
        /// <summary>
        /// 根据ID查找Customer记录
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public IQueryable GetChukuAll(DateTime date, String 发往单位)
        {
            var chuku = from p in db.产品出库清单
                        where p.发运时间 == date.Date && p.发往单位.Contains(发往单位)
                        select p;

            return chuku;
        }
        public IQueryable GetSaler(DateTime date)
        {
            var 到站 = (from p in db.产品出库清单
                      where p.发运时间 == date.Date
                      select p.发往单位).Distinct();

            return 到站;
        }
        public int GetChukuCount(DateTime date, String 发往单位)
        {
            var count = (from p in db.产品出库清单
                         where p.发运时间== date.Date && p.发往单位.Contains(发往单位)
                         select p).Count();

            return count;
        }
    }
}
